home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13097 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news1.intercall.com!usenet
  2. From: engevar@intercall.com (Steven Ovits)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: This should really be a simple question for you C-freaks...
  5. Date: Thu, 04 Apr 1996 19:45:16 GMT
  6. Organization: Intercall Inc.
  7. Message-ID: <4k0vd0$roo@news1.intercall.com>
  8. References: <4jrue1$gsu@nyheter.chalmers.se>
  9. NNTP-Posting-Host: ts2-105.intercall.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Tobias Nilsson <tb9593@ios.chalmers.se> wrote:
  13.  
  14. >Well, even a damn good assembler-programmer runs into trouble, 
  15. >sometimes...  ;)
  16.  
  17. >Anyway... I'm just trying to read the keyboard without having the 
  18. >characters displayed on the f-cking screen!  Just as that!  But I've
  19. >tried getchar, scanf, fun.01 int 21h... but they all display them...
  20. >I'm sure you had this question before... but I was playing with myself
  21. >that time, so I missed it... I want just pure ASCII, please help me!
  22. >(Ps... This is on the PC-platform... And I'm really fresh on C... and I 
  23. >hope there is a standard function for this...  ;) 
  24.  
  25. >Thanx!!!
  26. >  
  27.  
  28. Sorry. There is purposely no standard function to do this.
  29. In fact, it's much worse. There's no standard way to get any
  30. characters from the keyboard without pressing the enter key.
  31. This is because C needs to be portable to multi-terminal
  32. environments that don't communicate with the host except
  33. at defined times--such as when you press Enter.
  34.  
  35. Even on the PC, getch() will only read the characters from
  36. the keyboard after the Enter key is pressed.  You need to use
  37. a non standard method to get characters as they are pressed,
  38. regardless of whether you want them echoed to the screen or not.
  39. Every compiler vendor has a function for this.  Look for it
  40. under getkbd(), bioskey(), or some similar name.
  41.  
  42.  
  43.